[Data]
life = 1050
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 20
airjuggle = 25
sparkno = S6001
guard.sparkno = -1
KO.echo = 0
volume = 0
IntPersistIndex = 0
FloatPersistIndex = 0

[Size]
xscale = 1
yscale = 1
ground.back = 11
ground.front = 11
air.back = 13
air.front = 13
height = 28
attack.dist = 80
proj.attack.dist = 80
proj.doscale = 2
head.pos = 3, -45
mid.pos = 3, -16
shadowoffset = 0
draw.offset = 0,0

[Velocity]
walk.fwd  = 1.95
walk.back = -1.6
run.fwd  = 3.2,-3.8
run.back = -2.4,-3.8
jump.neu = 0,-7.65
jump.back = -2.05
jump.fwd = 2.1
runjump.back = -1.45,-3.1
runjump.fwd = 1.55,-3.1
airjump.neu = 0
airjump.back = 0
airjump.fwd = 0

[Movement]
airjump.num = 0
airjump.height = 0
yaccel = .45
stand.friction = .85
crouch.friction = .82

[Quotes]
victory1 = "Just another pest out of the way!"
victory2 = "Wasn't that an earth-shattering experience?"
victory3 = "Do I need to drill it in your head that you're awful?"
victory4 = "The good old pump and pop still does the trick!"
victory5 = "All right! I'm feeling pumped up now!"
victory6 = "...I'm feeling like I'm out of air now."
victory7 = "And I thought Kissy was enough trouble..."
victory8 = "I'll give Warpman this: he at least had a gun with his bombs."
;---------------------------------------------------------------------------
;Var List

;***Universal***
;var(0) = Command variable
;var(1) = Famicom Fighters character detection
;var(2) = First hit counter
;var(3) = Helper select
;var(4) = Victory quote variable
;var(5) = Juggle Count
;var(6) = Helper health
;var(7) = Helper meter
;var(8) = Pause variable
;var(9) = Special move combo condition
;var(10) = Command Detection
;var(20) = Detection for first hit of multi-hit/multi-state moves
;var(21) = Test Var
;var(22) = Identification Variable
;var(23) = Counter for Training Mode Detection
;var(24) = Training Mode Var	  
;var(25) = Death State Check
;var(27) = Test Var
;var(28) = Super Finish
;var(30) = Hide helper bars and move names
;var(31) = Max helper health
;var(32) = Countdown for helper select
;var(33) = Back Charge
;var(34) = Back Charge Ready
;var(35) = Down Charge
;var(36) = Down Charge Ready
;var(37) = Projectile Ready
;var(38) = Helper Ready
;var(39) = Helper Projectile Ready
;var(40) = Air Guard Option
;var(41) = Air Recovery Option
;var(42) = Helpers Option
;var(43) = Pause Option 
;var(44) = Control Scheme
;var(45) = Standalone Helper Bar (X-Position)
;var(46) = Standalone Helper Bar (Y-Position)
;var(47) = Standalone Helper Bar (BG)
;var(48) = Alt Victory Music
;var(50) = Reaction var
;var(51) = Tag team var
;var(52) = Projectile animation var
;var(53) = Assist check
;var(54) = Hyper Tag-In check
;var(55) = AI switch check
;var(58) = Special move command time var
;var(59) = AI Var
;fvar(0) = Helper bars scaling
;fvar(20) = Damage scaling, current power
;fvar(21) = Damage scaling, future power
;fvar(24) = Test Var
;fvar(30) = Special projectile Vel X
;fvar(31) = Special projectile Vel Y
;fvar(32) = Super projectile Vel X
;fvar(33) = Super projectile Vel Y
;fvar(34) = Helper projectile Vel X
;fvar(35) = Helper projectile Vel Y
;fvar(36) = Helper Vel X
;fvar(37) = Helper Vel Y


;***Specific***
;var(0) = Old variable used for Mario's and Urban Champ's throws.
;var(12) = Jumping Strong Punch air hit variable
;var(13) = Sky Kid Facing var
;fvar(10) = Air X-acceleration during air moves
;fvar(11) = Air Y-acceleration during air moves

;***Helpers***
;(Almost?) Universal
;-fvar(1) = Pos X coordinates
;-fvar(2) = Pos Y coordinates
;Mappy
;-var(1) = Turn var
;---------------------------------------------------------------------------
; Lose by Time Over
[Statedef 170]
type = S
ctrl = 0
anim = 5600
velset = 0,0

[State 170, 1]
type = PlaySnd
trigger1 = !Time
value = S11,1
channel = 10

[State 170, 2]
type = PlaySnd
trigger1 = Time = 60
value = S11,2
channel = 10

[State 170, 3]
type = PosSet
trigger1 = !AnimTime
y = 1000

;---------------------------------------------------------------------------
; Win state decider
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = !MatchOver && !Time
value = 181+8*Cond(NumEnemy,(enemy,Name = "Bonus" && enemy,Var(0) = 0 && enemy,Var(5) = 0),0)

[State 180, 2]
type = ChangeState
trigger1 = MatchOver && !Time
value = 182+7*Cond(NumEnemy,(enemy,Name = "Bonus" && enemy,Var(0) = 0 && enemy,Var(5) = 0),0)

;---------------------------------------------------------------------------
;Round Win
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

[State 181, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = S181,3

[State 7151, 2]
type = Helper
triggerall = NumHelper(7000) && var(3) = 1
trigger1 = !Time && BackEdgeDist > 10
name = "Sky Kid"
ID = 7150
stateno = 7152
pos = 0,0
postype = back
facing = 1
ownpal = 1
persistent = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7151, 3]
type = Helper
triggerall = NumHelper(7000) && var(3) = 1
trigger1 = !Time && BackEdgeDist <= 10
name = "Sky Kid"
ID = 7151
stateno = 7152
pos = 0,0
postype = front
facing = -1
ownpal = 1
persistent = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)
;---------------------------------------------------------------------------
;Match Win
[Statedef 182]
type = S
ctrl = 0
velset = 0,0
sprpriority = 1

[State 181, 1]
type = AssertSpecial
trigger1 = Time < 0+(150 * (PalNo = 1))+(100 * (PalNo = 2))+(160 * (PalNo = 3))+(130 * (PalNo = 4))+(180 * (PalNo = 5))+(280 * (PalNo = 6))
flag = roundnotover

[State 181, 2]
type = Explod
trigger1 = !Time
anim = 182
ID = 182
pos = ceil((-24+24*(BackEdgeDist < 24))*const(size.xscale)),0
postype = p1
removetime = -1
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ownpal = 1

[State 181, 3]
type = PlaySnd
triggerall = !NumPartner
trigger1 = !Time
value = S180,0+(PalNo - 1)

[State 181, 4]
type = PlaySnd
triggerall = NumPartner
trigger1 = (ID = 56 || ID = 58) && !Time
trigger2 = (ID = 57 || ID = 59) && partner,Alive = 0 && !Time
value = S180,0+(PalNo - 1)

[State 181, 5]
type = PosAdd
trigger1 = Time = [14, 19] 
x = 4*const(size.xscale)
y = (-2+4*(Time >= 17))*const(size.xscale)

[State 181, 6]
type = ScreenBound
trigger1 = 1
value = 0

[State 181, 7]
type = ChangeAnim
trigger1 = Time = 9
value = 181

[State 181, 8]
type = PlaySnd
trigger1 = Time = 9 
value = S181,1

[State 181, 9]
type = PlaySnd
trigger1 = Anim = 181 && AnimElem = 5
value = S181,2

[State 7151, 2]
type = Helper
triggerall = NumHelper(7000) && var(3) = 1
trigger1 = !Time && BackEdgeDist > 10
name = "Sky Kid"
ID = 7150
stateno = 7152
pos = 0,0
postype = back
facing = 1
ownpal = 1
persistent = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 7151, 3]
type = Helper
triggerall = NumHelper(7000) && var(3) = 1
trigger1 = !Time && BackEdgeDist <= 10
name = "Sky Kid"
ID = 7151
stateno = 7152
pos = 0,0
postype = front
facing = -1
ownpal = 1
persistent = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)
;---------------------------------------------------------------------------
; Introduction
[Statedef 191]
type = S
ctrl = 0
anim = 190
sprpriority = 5

[State 191, 1]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 2]
type = PlaySnd
trigger1 = !Time
value = S190,0
channel = 1

[State 191, 3]
type = StopSnd
trigger1 = Time = 165
channel = 1

[State 191, 4]
type = EnvShake
trigger1 = !Time
time = 165
freq = 120
ampl = -1

[State 191, 5]
type = ChangeState
trigger1 = !AnimTime
value = 0
;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
movetype = I
physics = S
ctrl = 0
anim = 195
velset = 0,0
sprpriority = 2

[State 195, 1]
type = Explod
trigger1 = AnimElem = 4
anim = 900+random%11
ID = 900
pos = ceil(33*const(size.xscale)),ceil(-28*const(size.xscale))
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 5
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1

[State 195, 5]
type = PlaySnd
trigger1 = AnimElem = 4
value = S195,0

[State 195, 7]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Taunt
[Statedef 900]
type = S
movetype = I
physics = S
ctrl = 0
anim = 1
velset = 0,0
sprpriority = 2

[State -2, 800]
type = Explod
trigger1 = enemynear(0), PrevStateNo = 4004 && enemynear(0),StateNo = 5150
anim = 918
ID = 800
pos = ceil(0+P2Dist X),0
postype = p1
facing = ifelse(Facing = -1, -1, 1)
bindtime = 1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
persistent = 0

[State -2, 1000]
type = Explod
trigger1 = enemynear(0), PrevStateNo = 5610 && enemynear(0),StateNo = 5150
anim = 919
ID = 1000
pos = ceil(0+P2Dist X),0
postype = p1
facing = ifelse(Facing = -1, -1, 1)
bindtime = 1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 3
ontop = 0
ownpal = 1
persistent = 0
;========================<EXPLODSIVE BUFFERING HELPER>=============================
[StateDef 90000005]
type = A
physics = N
moveType = I
anim = 1
velSet = 0,0
ctrl = 0
     
[State 90000005, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "by JustMorphPointman"
ignoreHitPause = 1
;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40]
Type= ChangeState
Triggerall= !Time
Triggerall= var(59) > 0
triggerall = !(P2MoveType = H && P2StateType = A) && !((enemynear(0),Pos Y < -55.1))
triggerall = fvar(30) <= 0 && fvar(32) <= 0 && fvar(34) <= 0 
triggerall = abs(P2BodyDist X > 39.6)
trigger1 = random < var(50)*3
value= 0
ctrl= 1

[State 40, 1]
type = VarSet
trigger1 = !Time
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
trigger1 = var(59)=0
trigger2 = var(59)>0
trigger2 = (P2MoveType = H && P2StateType = A) && (enemynear(0),Pos Y < -55.1);(P2MoveType = H && P2StateType = A) && enemynear(0),Pos Y < -70
trigger3 = var(59)>0
trigger3 = (abs(enemy,fvar(30) < 58.4) && (enemy,fvar(30) > 0)) || (abs(enemy,fvar(32) < 58.4) && (enemy,fvar(32) > 0)) || (abs(enemy,fvar(34) < 58.4) && (enemy,fvar(34) > 0))
trigger3 = (abs(enemy,fvar(31) > -42.6) && !(enemy,fvar(31) = 0)) || (abs(enemy,fvar(33) > -42.6) && !(enemy,fvar(33) = 0))|| (abs(enemy,fvar(35) > -42.6) && !(enemy,fvar(35) = 0))
trigger4 = var(59)>0
trigger4 = random<var(50)*3.6
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
trigger1 = var(59)=0
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = !AnimTime
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 5]
type = VelSet
trigger1 = !AnimTime
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 6]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1

[State 40, 7]
type = ChangeState
trigger1 = !AnimTime
value = 50
ctrl = 1

;---------------------------------------------------------------------------
;HIT_DEFEATED
[Statedef 5600]
type    = L
movetype= H
physics = N
sprpriority = -3
velset = 0,0
anim = 5600
ctrl = 0

[State 5400, 3]
type = PlaySnd
trigger1 = !Time
value = S11,1
channel = 10

[State 5400, 2]
type = PlaySnd
trigger1 = Time = 60
value = S11,2
channel = 10

[State 5400, 3]
type = PosSet
trigger1 = !AnimTime
y = 1000

[State 5400, 4]
type = ChangeState
trigger1 = !AnimTime
value = 5150

[State 5400, 5]
type = AssertSpecial
trigger1 = 1
flag = nomusic
flag2 = noshadow

[State 5400, 6]
type = AssertSpecial
trigger1 = 1
flag = roundnotover
